import 'package:flutter/material.dart';
import 'package:get/get.dart';

class WidgetUtil {
  WidgetUtil._init();

  static Widget processingStatusWidget(int status) {
    String str = "";
    if (status == 1) {
      str = "待开启";
    } else if (status == 2) {
      str = "进行中";
    } else {
      str = "公示中";
    }

    return Container(
      width: 30,
      height: 15,
      decoration: BoxDecoration(
          color: status == 1
              ? Colors.grey.withOpacity(0.5)
              : const Color(0x206BC7B3),
          borderRadius: BorderRadius.circular(2)),
      alignment: Alignment.center,
      child: Text(
        str,
        style: TextStyle(
            color: status == 1 ? Colors.grey : Color(0xFF6BC7B3), fontSize: 8),
      ),
    );
  }

  static Widget btnWidget(
      {required String title, VoidCallback? clickCallback}) {
    return InkWell(
      onTap: clickCallback,
      child: Container(
        width: Get.width * 0.6,
        height: 50,
        alignment: Alignment.center,
        decoration: BoxDecoration(
            color: const Color(0xFF9E57F3),
            borderRadius: BorderRadius.circular(10)),
        child: Text(
          title,
          style: const TextStyle(color: Colors.white70, fontSize: 18),
        ),
      ),
    );
  }
}
